<#include "/WEB-INF/fragment/head.ftl">
 <style type="text/css">
.head{background-color: rgb(208,14,49);padding-bottom: 10px;padding-top: 10px;margin-bottom: 0px;color: white;   }   
.login{background-color: gray;padding: 4px;}
.login-fr{padding-right: 10px;}
.title{padding-left:  20px;font-size: 18px;}
.underline{height: 2px;width: 1140px;background-color: red;margin-top: 50px;}
li{list-style-type: none;padding-left:250px;padding-bottom: 50px;}
input{width: 350px;padding: 10px;margin: 10px;}
.btn{background-color: green;width: 350px;padding: 10px;}
.btn1{background-color: green;width: 350px;padding: 10px;}
.img1{width: 80px;}
.img2{width: 80px;}
.img3{width: 80px;}
.img4{width: 80px;}
.img5{width: 80px;}
.btn2{color: blue;}
a>img{ width: 100px;height: 60px;}
    </style>
    </head>
<body>
    <div class="container">
        <div class="head clearfix">
            <div class="title fl"><a href="${request.contextPath}/index">教学过程控制系统</a></div>
            <div class="login-fr fr"><a href="${request.contextPath}/login"><img src="./assets/img/login.png"></a></div>
        </div>
        <div class="underline"></div>
         <div class="num-list clearfix">
            <ul>
                <li class="fl">1</li>
                <li class="fl">2</li>
                <li class="fl">3</li>
            </ul>
        </div>
 <div class="register-box">
   <div class="pic" align="center"><img src="http://172.16.1.55/logo.png"></div>
           
            <div class="input">
            <form class="form_submit" action="${request.contextPath}/_register1" method="post">
                 <div align="center"><input type="email" id="email" name="user.email" class="j_check" value=" 1638453366@qq.com" placeholder="邮箱"><span></span><p>
            ${FieldErrors['user.email']!""}
            </p></div>
                <div align="center"><input type="text" id="passwd" name="user.passwd" class="j_passwd" value="11" placeholder="密码"><span></span><p>
            ${FieldErrors['user.passwd']!""}
            </p></div>
                <div align="center"><input type="text" name="user.passwd2" placeholder="确认密码" value="11"><p>
            ${FieldErrors['user.passwd2']!""}
            </p>
             <#if ActionErrors??>
<#list ActionErrors as error>
        ${error}
</#list>
        </#if>
            </div>
                <div align="center"><button type="submit" class="btn1">下一步</button></div>
            </form>
            </div>
        </div>
    </div>
    
     <!-- <script type="text/javascript">
     
        $(document).on('submit', '.form_submit', function(event) {
       $.ajax({
            url: '${request.contextPath}/_register1',
              type: 'POST',
              dataType: 'text',
              data: {email: $("#email").val(),passwd: $("#passwd").val(),'struts.enableJSONValidation' : true},
             beforeSend: function(xhr){
             
              },
            complete: function(xhr, textStatus) {
              //called when complete
            },
            success: function(data, textStatus, xhr) {
              //called when successful
              console.log(data, textStatus, xhr);
           var d=JSON.parse(data);
                for(var r in d){
                    $('.j_check').siblings('span').html(d[r].user.email);
                    $('.j_passwd').siblings('span').html(d[r].user.passwd);
            }
            },
            error: function(xhr, textStatus, errorThrown) {
              //called when there is an error
            }
          });
        return false;
          });
       // $(document).on('blur', '.j_check', function(event) {
         //   validate();
       //     event.preventDefault();
      //  });
      //  function validate(){
        //1.创建xml对象
      //  var xmlHttpRequest = new XMLHttpRequest();
        //2.设置回调函数
     //   xmlHttpRequest.onreadystatechange =function() {
     //   if(xmlHttpRequest.readyState == 4 && xmlHttpRequest.status == 200) {
     //      var data = xmlHttpRequest.responseText;
     //       $('.j_check').siblings('span').html(data);
         //    }
      //   }; 
         // 3.初始化XMLHttpRequest组件
       //  xmlHttpRequest.open("post", "${request.contextPath}/_register1", true); // post 方式
       //  xmlHttpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
         // 4.发送请求
       //  var data="user.email=" + $('input[name=\'user.email\']').val(); // 需要发送的数据信息，name为用户名输入框获取的值
       //  xmlHttpRequest.send(data);
     
         //    }
         </script> -->
</body>
</html>